package com.market.dao;

import java.util.List;

import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.security.core.userdetails.UsernameNotFoundException;

import com.market.domain.AccountRecord;
import com.market.domain.Message;
import com.market.domain.Order;
import com.market.domain.Role;
import com.market.domain.User;
import com.market.domain.UserActivityRecord;

public interface UserDao extends GenericDao<User, Long>{
	/**
	 * This method load all roles associated with user.
	 * @param user
	 * @return
	 */
	public List<Role> findRoles(User user);
	
	/**
	 * This method load all messages related with this user;
	 * @param user
	 * @return
	 */
	public List<Message> findMessages(User user);
	
	/**
	 * This method load all orders of this user;
	 * @param user
	 * @return
	 */
	public List<Order> findOrders(User user);
	
	/**
	 * This method load all account record of this user
	 * @param user
	 * @return
	 */	
	public List<AccountRecord> findAccountRecords(User user);
	
	/**
	 * This method load all user activity record of this user
	 * @param user
	 * @return
	 */	
	public List<UserActivityRecord> findUserActivityRecords(User user);
	
	public User findByEmailAndPassword(String email, String password);
	
	public User findByEmail(String email);
	
	public User findByTelephone(String telephone);
	
	public User activateAccount(Long id, String activatedCode);

}
